//
//  QLMEditTabCell.m
//  Xiaomakuaixiu
//
//  Created by 龚碧容 on 2017/10/7.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "QLMEditTabCell.h"

@implementation QLMEditTabCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)deleteBtnAction:(UIButton *)sender{
    [_delegate _deleteAddressAction:sender.tag];
}

- (IBAction)editBtnAction:(UIButton *)sender{
    [_delegate _editAddressAction:sender.tag];
}

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    
    static NSString *identifiew=@"EditCellId";
    QLMEditTabCell *cell=[tableView dequeueReusableCellWithIdentifier:identifiew];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle] loadNibNamed:@"QLMEditTabCell" owner:nil options:nil] firstObject];
        
        UIView *lineView=[[UIView alloc]  initWithFrame:CGRectMake(20,cell.morenAddrBtn.frame.size.height, kScreen_width-40, 0.5)];
        lineView.backgroundColor=[UIColor lightGrayColor];
        [cell addSubview:lineView];
        
        UIFont *aFont=[UIFont systemFontOfSize:16];
        
        cell.addressDetailLabel.font=aFont;
        cell.addressValLabel.font=[UIFont systemFontOfSize:14];
        
        cell.morenAddrBtn.titleLabel.font=aFont;
        cell.editBtn.titleLabel.font=aFont;
        cell.deleteBtn.titleLabel.font=aFont;
    }
    return cell;
}

@end
